using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

namespace Auto.Data.Systems.BLL
{
    /// <summary>
    /// 
    /// </summary>
    public class PagerList
    {
        private readonly Auto.Data.Systems.DAL.PagerList dal = new Auto.Data.Systems.DAL.PagerList();

        /// <summary>
        /// Gets the list.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="getColName">Name of the get col.</param>
        /// <param name="where">The where.</param>
        /// <param name="orderByName">Name of the order by.</param>
        /// <param name="orderByType">Type of the order by.</param>
        /// <returns></returns>
        public DataTable GetList(string tableName, string getColName, string where, string orderByName, string orderByType)
        {
            return dal.GetList(tableName, getColName, where, orderByName, orderByType);
        }
        /// <summary>
        /// Gets the list.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="tablePrimaryKey">The table primary key.</param>
        /// <param name="getColName">Name of the get col.</param>
        /// <param name="where">The where.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="orderByName">Name of the order by.</param>
        /// <param name="orderByType">Type of the order by.</param>
        /// <returns></returns>
        public DataTable GetList(string tableName, string tablePrimaryKey, string getColName, string where, int pageSize, int pageIndex, string orderByName, string orderByType)
        {
            return dal.GetList(tableName, tablePrimaryKey, getColName, where, pageSize, pageIndex, orderByName, orderByType);
        }

        /// <summary>
        /// Counts the specified table name.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        public int Count(string tableName, string where)
        {
            return dal.Count(tableName, where);
        }
    }
}
